<script setup lang="ts">
import { useHasPermi } from '@/hooks/useHasPermi';
import { computed } from 'vue';

interface Props {
  hasPermi?: string[]; // 按钮权限
}

const props = defineProps<Props>();
const hasPermi = useHasPermi();

const isVisible = computed(() => hasPermi(props.hasPermi ?? []));
</script>

<template>
  <span v-if="isVisible" v-bind="$attrs" style="display: contents">
    <slot></slot>
  </span>
</template>
